/*
 *  您可以更改此项目但请不要删除作者署名谢谢，否则根据中华人民共和国版权法进行处理.
 *  You may change this item but please do not remove the author's signature,
 *  otherwise it will be dealt with according to the Copyright Law of the People's Republic of China.
 *
 *  如果需要联系到我请加Wechat: yangbuyiya 备注交流学习
 *  If you need to contact me, please add Wechat: yangbuyiya as a note to exchange and learn.
 *  yangbuyi Copyright (c) https://yby6.com 2024.
 */

package com.yby6.controller;


import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.Param;
import org.noear.solon.core.handle.MethodType;
import org.noear.solon.core.handle.UploadedFile;

/**
 * 文件上传测试
 *
 * @author Yang Shuai
 * Create By 2024/06/26
 */
@Controller
@Mapping("upload")
public class UploadController {
    
    
    /*
     * 文件上传
     * */
    @Mapping(value =  "file", method = MethodType.POST)
    public String file(@Param("file") UploadedFile file) {
        System.out.println(file);
        return "success," + file.getName();
    }
    
}
